﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.ComponentModel.DataAnnotations;
using OpenMVCRM.Entities;

namespace OpenMVCRM.ViewModels
{
    public class ClientViewModel
    {
        public int ID { set; get; }

        [Required]
        public string Name { set; get; }     
        public IEnumerable<PhoneNumberViewModel> PhoneNumbers { set; get; }
        public string WebSite { set; get; }

        public string IndustryName { set; get; }

        [DataType(DataType.MultilineText)]
        public string Description { set; get; }

        public string CategoryName { set; get; }

        public PhoneNumberViewModel PrimaryPhone { set; get; }

        public bool IsDisplayable { set; get; }

        public IEnumerable<IndustryViewModel> Industries { set; get; }
        
        


        [Required]
        [Display(Name="Industry")]
        public int SelectedIndustryId { set; get; }

        public string Message { set; get; }
        public string ErrorMessage { set; get; }

        public string AddressLine1 { set; get; }
        public string AddressLine2 { set; get; }
        public string City { set; get; }
        public string StateName { set; get; }
        public string ZipCode { set; get; }
        public bool IsPrimary { set; get; }

        public string CountryName { set; get; }
        //public virtual Country Country { set; get; }
        //public virtual State State { set; get; }


        public IEnumerable<Country> Countries { set; get; }
        public int? SelectedCountryID { set; get; }

        public IEnumerable<State> States { set; get; }
        public int? SelectedStateID { set; get; }


        public ClientViewModel()
        {
        
            if (PhoneNumbers == null)
                PhoneNumbers = new List<PhoneNumberViewModel>();

            if (PrimaryPhone == null)
                PrimaryPhone = new PhoneNumberViewModel();

            if (Industries == null)
                Industries = new List<IndustryViewModel>();

            if (Countries == null)
                Countries = new List<Country>();

            if (States == null)
                States = new List<State>();

        }

    }
}